import React, { Fragment } from 'react';

import moment from 'moment';

import { Divider } from 'antd';

export default [{
  title: '奖品名称',
  dataIndex: 'GoodsPrizes',
  // width: '25%',
  render: text => Array.isArray(text) && text.map(({ title }, key) => (
    <Fragment key={key}>
      {title}
      <Divider dashed style={{margin: 0}} />
    </Fragment>
  )),
}, {
  title: '开奖条件',
  dataIndex: 'type',
  render: text => <span style={{whiteSpace: 'nowrap'}}>{text === 0 ? '按时间开奖' : text === 1 ? '按人数开奖' : '其它'}</span>,
}, {
  title: '开奖人数',
  dataIndex: 'number',
  render: text => < > { text } 人 < />,
}, {
  title: '发起人',
  dataIndex: 'nickname',
}, {
  title: '赞助商名称',
  dataIndex: 'sponsor',
}, {
  title: '开奖时间',
  dataIndex: 'endAt',
  render: val => <span style={{whiteSpace: 'nowrap'}}>{moment(val).format('YYYY-MM-DD HH:mm')}</span>,
}];